package uk.ac.glasgow.demosocs.tests;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


import uk.ac.glasgow.demosocs.VotingSystem;
import uk.ac.glasgow.demosocs.impl.VotingSystemStub;

public class SelectElectionTest{

	VotingSystem vs;

	@Before
	public void setUp() throws Exception{
		vs = new VotingSystemStub();	
		vs.setCurrentUser("002", "pass");		
		vs.createElection("test", "P");		
		Date open = new Date("19/2/12");
		Date start = new Date("20/2/12");
		Date end = new Date("21/2/12");		
		vs.editElection(open,start, end, "008");
		
	}

	@After
	public void tearDown() throws Exception{
		vs = null;		
	}

	@Test 
	public void testSelectElection(){
		vs.setCurrentElection("test");
		String check = vs.getCurrentElection().getEID();
		assertEquals("test", check);
		
	}
}